<template>
    <component :is="currentLoginComponent"></component>
</template>

<script>
import bangding720p from '@/views/components/bangding/bangding720p.vue'
import bangding1080p from '@/views/components/bangding/bangding1080p.vue'

export default {
  name: "bangding",
  components: {
    bangding720p,
    bangding1080p
  },
  data() {
    return {
      windowWidth: window.innerWidth,
      currentLoginComponent: 'login1080p',
      redirect:''
    }
  },
  watch: {
    $route: {
      handler: function (route) {
        this.redirect = route.query && route.query.redirect;
      },
      immediate: true
    }
  },
  created() {
   window.addEventListener('resize', this.handleResize)
    this.setLoginComponent()
  },
  methods: {
    handleResize() {
      this.windowWidth = window.innerWidth
      this.setLoginComponent()
    },
     setLoginComponent() {
      console.log(this.windowWidth)
      if (this.windowWidth <= 1300) {
        this.currentLoginComponent = 'bangding720p'
      } else {
        this.currentLoginComponent = 'bangding1080p'
      }
    }
  }
}
</script>


<style scoped lang="scss">

</style>
